<?php

namespace App\Http\Controllers\Api;

use Admin\Resources\ErrorResource;
use App\Repositories\Contracts\BookingInterface;
use App\Repositories\Contracts\CabinSetInterface;
use App\Repositories\Contracts\PolicyInterface;
use App\Repositories\Contracts\PolicyProductMarkInterface;
use App\Repositories\Contracts\RuleSetInterface;
use Illuminate\Http\Request;
use MakeRep\Controllers\BaseController;
use MakeRep\Resources\BaseResource;

class PolicyController extends BaseController
{
    private $bookingInterface;
    private $cabinSetInterface;
    private $ruleSetInterface;

    private $policyProductMarkInterface;
    public function __construct(PolicyInterface $interface,BookingInterface $bookingInterface,
                                CabinSetInterface $cabinSetInterface,RuleSetInterface $ruleSetInterface,
                                PolicyProductMarkInterface $policyProductMarkInterface)
    {
        parent::__construct($interface);
        $this->bookingInterface = $bookingInterface;
        $this->cabinSetInterface = $cabinSetInterface;
        $this->ruleSetInterface = $ruleSetInterface;
        $this->policyProductMarkInterface = $policyProductMarkInterface;
    }




    /**
     * 获取详情
     * @param Request $request
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View|BaseResource|\MakeRep\Resources\ErrorResource
     */
    public function getInfoByAirline(Request $request)
    {
        $bookings = $this->interface->get(['status'=>1,'airline'=>$request->airline]);

        return new BaseResource($bookings);
    }
}